/*
 * =====================================================================================
 * Copyright (C) 2023 Ingenic Semiconductor Co.,Ltd
 * All Rights Reserved
 *
 * Filename     : completion.h
 * Author       : Keven <keven.ywhan@ingenic.com>
 * Created      : 2024/06/19 11:46
 * Description  :
 *
 * =====================================================================================
 */

#ifndef __COMPLETION_H__
#define __COMPLETION_H__

#include "FreeRTOS.h"
#include "queue.h"
#include "semphr.h"

struct completion {
	SemaphoreHandle_t wait;
};

void init_completion(struct completion *x);
void reinit_completion(struct completion *x);
void wait_for_completion(struct completion *x);
uint32_t wait_for_completion_timeout(struct completion *x, uint32_t timeout);
void complete(struct completion *x);
void complete_isr(struct completion *x);


#endif /* __COMPLETION_H__ */

